package com.matrix.java.chap_05;

/*
    显示闰年
 */
public class Ex5_27 {
    public static void main(String[] args) {
        int count = 0;

        for (int i = 101; i <= 2100; i++) {
            boolean leapYear = false;
            if (i % 400 == 0) {
                leapYear = true;
                count++;
            } else if (i % 4 == 0) {
                leapYear = true;
                count++;
            }
            if (leapYear && count % 10 == 0) {
                System.out.println(i);
            } else if (leapYear) {
                System.out.print(i + " ");
            }
        }
        System.out.println("total: " + count);
    }
}
